raspbian-triplet
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Wed, 4 Jun 2025 04:23:54 +0000 (04:23 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Wed, 4 Jun 2025 04:23:54 +0000 (04:23 +0000)
hack to replace arm version in triplet returned by config.guess
with the one we want for raspbian.

Gbp-Pq: Name raspbian-triplet.patch

compiler-rt/cmake/base-config-ix.cmake
llvm/cmake/config.guess.hack [new file with mode: 0644]
llvm/cmake/modules/GetHostTriple.cmake

index 908c8a40278cf0cd1ed95cf8225c182942152d5e..a2074e9c84385fe89f0d3adfa3065c11c0ceaff4 100644 (file)
@@ -257,10 +257,9 @@ macro(test_targets)
       if(WIN32)
         test_target_arch(arm "" "" "")
       else()
-        test_target_arch(armv4t "" "-march=armv4t" "-mfloat-abi=soft")
+        test_target_arch(arm "" "" "-mfloat-abi=soft")
+        test_target_arch(armhf "" "" "-mfloat-abi=hard")
         test_target_arch(armv6m "" "-march=armv6m" "-mfloat-abi=soft")
-        test_target_arch(arm "" "-march=armv7-a" "-mfloat-abi=soft")
-        test_target_arch(armhf "" "-march=armv7-a" "-mfloat-abi=hard")
       endif()
     elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "avr")
       test_target_arch(avr "__AVR__" "--target=avr")
diff --git a/llvm/cmake/config.guess.hack b/llvm/cmake/config.guess.hack
new file mode 100644 (file)
index 0000000..13b18bf
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash -e
+$(dirname "$0")/config.guess | sed -r s/arm[a-zA-Z0-9]*/armv6/
index 1be13bc01ab9b255f70994938e3fb167a569d367..c9b870a2e2c80fcafcd712676522cacdaadd2719 100644 (file)
@@ -45,7 +45,7 @@ function( get_host_triple var )
     if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows AND NOT MSYS)
       message(WARNING "unable to determine host target triple")
     else()
-      set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess)
+      set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess.hack)
       execute_process(COMMAND sh ${config_guess}
         RESULT_VARIABLE TT_RV
         OUTPUT_VARIABLE TT_OUT